﻿// 1.3.1.1.2. Miss Cat -> http://bgcoder.com/Contest/DownloadTask/6

using System;
//using System.Collections.Generic;
//using System.Linq;

class MissCat
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] marks = new int[10];  //List<int> marks = new List<int> { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

        for (int i = 0; i < n; i++)
        {
            byte jury = byte.Parse(Console.ReadLine());
            marks[jury - 1]++;
        }
        //Console.WriteLine(marks.IndexOf(marks.Max()) + 1);

        int bestCat = -1;
        for (int i = 0; i < 10; i++)
        {
            if (marks[i] > bestCat)
            {
                bestCat = marks[i];
            }
        }
        for (int i = 0; i < 10; i++)
        {
            if (marks[i] == bestCat)
            {
                bestCat = i;
                break;
            }
        }

        Console.WriteLine(bestCat + 1);


        ////////// retarded algorithm which makes 2 many calculations - even more than factorial of the jury //////////

        //int N = int.Parse(Console.ReadLine());
        //int[] marks = new int[N];
        //int mostMarked = 0;
        //int bestcounter = 1;

        //for (int x = 0; x < N; x++)
        //{
        //    int counter = 1;
        //    for (int j = x + 1; j < N; j++)
        //    {
        //        if (marks[x] == marks[j])
        //        {
        //            counter++;
        //            if (counter > bestcounter)
        //            {
        //                bestcounter = counter;
        //                mostMarked = marks[j];
        //            }
        //        }
        //    }
        //}

        //Console.WriteLine(mostMarked);

    }
}